package main

import "fmt"

func main() {
	var name string = "Go 编程时光"
	fmt.Println(name)

	var rate float32 = 0.89
	fmt.Println(rate)

	var (
		name1   string
		age1    int
		gender1 string
	)
	fmt.Println(name1, age1, gender1)

	name2 := "Go 编程时光"
	fmt.Println(name2)

	name3, age3 := "wangbm", 28
	fmt.Println(name3, age3)

	var a int = 100
	var b int = 200
	b, a = a, b
	fmt.Println(a, b)

	var age int = 28
	var ptr = &age
	fmt.Println("age: ", age, " ptr: ", ptr)

	ptr1 := new(int)
	fmt.Println("ptr address: ", ptr1)
	fmt.Println("ptr value: ", *ptr1)

	fmt.Println(newInt1())
	fmt.Println(newInt2())

	a1, _ := GetData()
	_, b1 := GetData()
	fmt.Println(a1, b1)
}

func GetData() (int, int) {
	return 100, 200
}

func newInt1() *int {
	return new(int)
}

func newInt2() *int {
	var dummy int
	return &dummy
}
